

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>文档编译错误 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="TODO for Chinese" href="../todo/" />
    <link rel="prev" title="词语翻译惯例" href="../translation-convention/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../">Ceph 中文文档翻译资源</a></li>
      <li class="breadcrumb-item active">文档编译错误</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../_sources/translation_cn/build-errors.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">中文版翻译资源</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../README/">项目介绍</a></li>
<li class="toctree-l2"><a class="reference internal" href="../translation-convention/">词句翻译约定</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">文档编译错误</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id2">万精油</a></li>
<li class="toctree-l3"><a class="reference internal" href="#importerror-librados-so-cannot-open-shared-object-file-no-such-file-or-directory">ImportError: librados.so: cannot open shared object file: No such file or directory</a></li>
<li class="toctree-l3"><a class="reference internal" href="#inline-emphasis-start-string-without-end-string">Inline emphasis start-string without end-string</a></li>
<li class="toctree-l3"><a class="reference internal" href="#rados-rados-size-changed">rados.Rados size changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="#bad-magic-number-in-rados-b-x03xf3rn">bad magic number in ‘rados’: b’x03xf3rn’</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../todo/">TODO for Chinese</a></li>
<li class="toctree-l2"><a class="reference internal" href="../todo/#todo-for-raw-doc-english-version">TODO for raw doc (English version)</a></li>
</ul>
</li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="id1">
<h1>文档编译错误<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h1>
<section id="id2">
<h2>万精油<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p>有错误就试试升级 python 库，或者哪个库出问题了，就试试它的其它版本（开发者可能只是测试过了他自己的版本，没考虑其它版本能不能跑通）。</p>
</section>
<section id="importerror-librados-so-cannot-open-shared-object-file-no-such-file-or-directory">
<h2>ImportError: librados.so: cannot open shared object file: No such file or directory<a class="headerlink" href="#importerror-librados-so-cannot-open-shared-object-file-no-such-file-or-directory" title="Permalink to this heading"></a></h2>
<p>错误消息:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>(virtualenv) 18:14:06 /git/ceph/build-doc/virtualenv $ python
&gt;&gt;&gt; import rados
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
ImportError: librados.so: cannot open shared object file: No such file or directory
&gt;&gt;&gt;
</pre></div>
</div>
<p>原因：没找到对应的库。编译文档需要系统上也安装 ceph 软件。</p>
<p>解决方法：手动链接到系统库位置，需 root 权限。</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="m">18</span>:15:27<span class="w"> </span>~<span class="w"> </span><span class="c1"># cd /usr/lib64/</span>
<span class="m">18</span>:16:54<span class="w"> </span>/usr/lib64<span class="w"> </span><span class="c1"># ln -s /git/ceph/build-doc/virtualenv/lib64/lib* .</span>
</pre></div>
</div>
</section>
<section id="inline-emphasis-start-string-without-end-string">
<h2>Inline emphasis start-string without end-string<a class="headerlink" href="#inline-emphasis-start-string-without-end-string" title="Permalink to this heading"></a></h2>
<p>错误消息:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="o">...</span><span class="p">]</span>
<span class="n">Running</span> <span class="n">Sphinx</span> <span class="n">v1</span><span class="mf">.8.3</span>
<span class="n">loading</span> <span class="n">pickled</span> <span class="n">environment</span><span class="o">...</span> <span class="n">done</span>
<span class="n">building</span> <span class="p">[</span><span class="n">mo</span><span class="p">]:</span> <span class="nb">all</span> <span class="n">of</span> <span class="mi">0</span> <span class="n">po</span> <span class="n">files</span>
<span class="n">building</span> <span class="p">[</span><span class="n">dirhtml</span><span class="p">]:</span> <span class="nb">all</span> <span class="n">source</span> <span class="n">files</span>
<span class="n">updating</span> <span class="n">environment</span><span class="p">:</span> <span class="p">[</span><span class="n">extensions</span> <span class="n">changed</span><span class="p">]</span> <span class="mi">286</span> <span class="n">added</span><span class="p">,</span> <span class="mi">3</span> <span class="n">changed</span><span class="p">,</span> <span class="mi">128</span> <span class="n">removed</span>
<span class="n">reading</span> <span class="n">sources</span><span class="o">...</span> <span class="p">[</span><span class="mi">100</span><span class="o">%</span><span class="p">]</span> <span class="n">translation</span><span class="o">-</span><span class="n">convention</span>
<span class="ne">Warning</span><span class="p">,</span> <span class="n">treated</span> <span class="k">as</span> <span class="n">error</span><span class="p">:</span>
<span class="n">docstring</span> <span class="n">of</span> <span class="n">rados</span><span class="o">.</span><span class="n">Rados</span><span class="o">.</span><span class="n">require_state</span><span class="p">:</span><span class="mi">1</span><span class="p">:</span><span class="n">Inline</span> <span class="n">emphasis</span> <span class="n">start</span><span class="o">-</span><span class="n">string</span> <span class="n">without</span> <span class="n">end</span><span class="o">-</span><span class="n">string</span><span class="o">.</span>
</pre></div>
</div>
<p>原因：可能是文档没更新到此处。主流文档可能已经删除了 rados.Rados.require_state ，而翻译的文档还存在此条。</p>
<p>解决方法：更新文档，删除相应条目。</p>
</section>
<section id="rados-rados-size-changed">
<h2>rados.Rados size changed<a class="headerlink" href="#rados-rados-size-changed" title="Permalink to this heading"></a></h2>
<p>错误消息:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="o">...</span><span class="p">]</span>
<span class="n">Successfully</span> <span class="n">built</span> <span class="n">rgw</span>
<span class="n">Installing</span> <span class="n">collected</span> <span class="n">packages</span><span class="p">:</span> <span class="n">rgw</span>
<span class="n">Successfully</span> <span class="n">installed</span> <span class="n">rgw</span><span class="o">-</span><span class="mf">2.0.0</span>
<span class="n">Running</span> <span class="n">Sphinx</span> <span class="n">v1</span><span class="mf">.8.3</span>
<span class="n">building</span> <span class="p">[</span><span class="n">mo</span><span class="p">]:</span> <span class="nb">all</span> <span class="n">of</span> <span class="mi">0</span> <span class="n">po</span> <span class="n">files</span>
<span class="n">building</span> <span class="p">[</span><span class="n">dirhtml</span><span class="p">]:</span> <span class="nb">all</span> <span class="n">source</span> <span class="n">files</span>
<span class="n">updating</span> <span class="n">environment</span><span class="p">:</span> <span class="mi">285</span> <span class="n">added</span><span class="p">,</span> <span class="mi">0</span> <span class="n">changed</span><span class="p">,</span> <span class="mi">0</span> <span class="n">removed</span>
<span class="n">reading</span> <span class="n">sources</span><span class="o">...</span> <span class="p">[</span><span class="mi">100</span><span class="o">%</span><span class="p">]</span> <span class="n">translation</span><span class="o">-</span><span class="n">convention</span>

<span class="ne">Warning</span><span class="p">,</span> <span class="n">treated</span> <span class="k">as</span> <span class="n">error</span><span class="p">:</span>
<span class="n">autodoc</span><span class="p">:</span> <span class="n">failed</span> <span class="n">to</span> <span class="kn">import</span> <span class="nn">module</span> <span class="sa">u</span><span class="s1">&#39;rgw&#39;</span><span class="p">;</span> <span class="n">the</span> <span class="n">following</span> <span class="n">exception</span> <span class="n">was</span> <span class="n">raised</span><span class="p">:</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
  <span class="n">File</span> <span class="s2">&quot;/git/ceph/build-doc/virtualenv/lib/python2.7/site-packages/sphinx/ext/autodoc/importer.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">154</span><span class="p">,</span> <span class="ow">in</span> <span class="n">import_module</span>
    <span class="nb">__import__</span><span class="p">(</span><span class="n">modname</span><span class="p">)</span>
  <span class="n">File</span> <span class="s2">&quot;rados.pxd&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">14</span><span class="p">,</span> <span class="ow">in</span> <span class="n">init</span> <span class="n">rgw</span>
<span class="ne">ValueError</span><span class="p">:</span> <span class="n">rados</span><span class="o">.</span><span class="n">Rados</span> <span class="n">size</span> <span class="n">changed</span><span class="p">,</span> <span class="n">may</span> <span class="n">indicate</span> <span class="n">binary</span> <span class="n">incompatibility</span><span class="o">.</span> <span class="n">Expected</span> <span class="mi">80</span> <span class="kn">from</span> <span class="nn">C</span> <span class="n">header</span><span class="p">,</span> <span class="n">got</span> <span class="mi">32</span> <span class="kn">from</span> <span class="nn">PyObject</span>
</pre></div>
</div>
<p>解决方法：</p>
<ul class="simple">
<li><p>升级 Python，如 2.7 -&gt; 3.6</p></li>
<li><p>升级 Cython</p></li>
<li><p>升级前述二者</p></li>
</ul>
</section>
<section id="bad-magic-number-in-rados-b-x03xf3rn">
<h2>bad magic number in ‘rados’: b’x03xf3rn’<a class="headerlink" href="#bad-magic-number-in-rados-b-x03xf3rn" title="Permalink to this heading"></a></h2>
<p>错误消息:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>22:22:13 /git/ceph $ ./admin/build-doc
Top Level States:  [&#39;RecoveryMachine&#39;]
Branch &#39;py3&#39; set up to track remote branch &#39;py3&#39; from &#39;origin&#39;.
Switched to a new branch &#39;py3&#39;
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing /git/ceph/src/pybind/rados
Installing collected packages: rados
  Running setup.py install for rados ... done
Successfully installed rados-2.0.0
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing /git/ceph/src/pybind/rbd
Installing collected packages: rbd
  Running setup.py install for rbd ... done
Successfully installed rbd-2.0.0
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing /git/ceph/src/pybind/cephfs
Installing collected packages: cephfs
  Running setup.py install for cephfs ... done
Successfully installed cephfs-2.0.0
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing /git/ceph/src/pybind/rgw
Installing collected packages: rgw
  Running setup.py install for rgw ... done
Successfully installed rgw-2.0.0
Running Sphinx v1.8.3
building [mo]: all of 0 po files
building [dirhtml]: all source files
updating environment: 285 added, 0 changed, 0 removed
reading sources... [100%] translation-convention

Warning, treated as error:
autodoc: failed to import method &#39;Rados.conf_get&#39; from module &#39;rados&#39;; the following exception was raised:
bad magic number in &#39;rados&#39;: b&#39;\x03\xf3\r\n&#39;
</pre></div>
</div>
<p>解决方法：</p>
<ol class="arabic">
<li><p>Python 版本可能不对，我这里是用了 Python 3.6，但当前只支持
3.4 、 3.5</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">/</span><span class="n">git</span><span class="o">/</span><span class="n">ceph</span><span class="o">/</span><span class="n">build</span><span class="o">-</span><span class="n">doc</span>
<span class="n">python3</span><span class="mf">.5</span> <span class="o">-</span><span class="n">m</span> <span class="n">venv</span> <span class="n">virtualenv</span><span class="o">/</span>
</pre></div>
</div>
</li>
<li><p>用更高版本的 Python 。 Python 3 向前兼容，但未必向后兼容；有些开发者可能用了最新版 Python 的功能，而这个功能可能在
<code class="docutils literal notranslate"><span class="pre">setup.py</span></code> 里声明的 Python 版本中不支持，所以应该尝试下更高版本的 Python</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">/</span><span class="n">git</span><span class="o">/</span><span class="n">ceph</span><span class="o">/</span><span class="n">build</span><span class="o">-</span><span class="n">doc</span>
<span class="n">python3</span><span class="mf">.6</span> <span class="o">-</span><span class="n">m</span> <span class="n">venv</span> <span class="n">virtualenv</span><span class="o">/</span>
</pre></div>
</div>
</li>
<li><p>Python 的缓存文件问题，删除即可:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">/</span><span class="n">git</span><span class="o">/</span><span class="n">ceph</span>
<span class="n">find</span> <span class="n">build</span><span class="o">-</span><span class="n">doc</span><span class="o">/</span> <span class="n">src</span><span class="o">/</span> <span class="o">-</span><span class="n">name</span> \<span class="o">*.</span><span class="n">pyc</span> <span class="o">-</span><span class="n">exec</span> <span class="n">rm</span> <span class="o">-</span><span class="n">vf</span> <span class="p">{}</span> <span class="o">+</span>
</pre></div>
</div>
</li>
</ol>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../translation-convention/" class="btn btn-neutral float-left" title="词语翻译惯例" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../todo/" class="btn btn-neutral float-right" title="TODO for Chinese" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>